============================================================================================================================
Modification Name: Portal System Addon: Ten Richest Members v1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Last Updated: 04/09/2010

Description:
This modification will add a block to your Portal that will display the 10 richest members on your board.

Supported Version: XMB 1.9.5 SP1

Updated for 1.9.5 by: WormHole @XMB Garage

Notes:
This modification requires XMB Portal v2.4 and the Shop Hack v1.3 to be installed before installing.

This modification is released under the GPL. A copy is provided with this software package.

Please backup your files before installing this modification.
Neither XMB Garage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.
============================================================================================================================
=======
Step 1:
=======
======================
Edit File: lang/Portal.lang.php
======================
============================
Add Code To End Of File Above  ?>
============================

// Portal System Addon: Ten Richest Members Mod Begin
// Ten Richest Members Mod Begin
$lang['tenrichest'] = "10 Richest Members";
// Portal System Addon: Ten Richest Member Mod End

============================================================================================================================
=======
Step 2:
=======
================
Edit File: portal.php
================
==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'portal_richest',

==========
Find Code:
==========

$sql = $db->query("SELECT p.*, t.* FROM $table_portal_templates p LEFT JOIN $table_templates t ON t.name = p.name WHERE p.status = 'on' ORDER BY p.displayorder ASC  LIMIT 0 , 30");

===============
Add Code Above:
===============

// Portal System Addon: Ten Richest Members Mod Begin
$richestmembers = array();
$richestquery = $db->query("SELECT username, money FROM $table_members ORDER BY money DESC LIMIT 10");
while($richest = $db->fetch_array($richestquery)) {
    $richestmembers[] = "<tr>\n<td class=\"tablerow\" bgcolor=\"$altbg2\"><a href=\"./member.php?action=viewpro&member=".rawurlencode($richest[username])."\">$richest[username]</a></td><td class=\"tablerow\" bgcolor=\"$altbg1\">$richest[money]</td>\n</tr>";
}
$richestmembers = implode("\n", $richestmembers);
// Portal System Addon: Ten Richest Members Mod End

============================================================================================================================
=======
Step 3:
=======
==================================================
Go To Administration Panel --> Portal Settings --> Add Portal Blocks
==================================================
=========================
Create New Block: portal_richest
=========================
==================
Add Code and Submit:
==================

<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="$bordercolor">
<tr>
<td>
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr>
<td class="category" colspan="2"><strong><font color="$cattext">&raquo; $lang[tenrichest]</font></strong></td>
$richestmembers
</table>
</td>
</tr>
</table>

============================================================================================================================
Enjoy!